﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Diagnostics;
using CocosDenshion;
using cocos2d;

namespace Meteorite
{

    public class Stone : Object
    {

        public Stone(Model model)
            :base(model)
        {
            
        }

        public override void CollideWithShip(Ship ship)
        {
            if (Meteorite.ship.CanBeHit())
            {
                Meteorite.explosionEmitter.Explode(20, Position, 0.1f);
                Meteorite.ship.Demange();
                Valid = false;
                if (0 == UserData.Instance().GetValue(GameConstant.UserData_Sound))
                {
                    SimpleAudioEngine.sharedEngine().playEffect(CCFileUtils.fullPathFromRelativePath(GameConstant.Sound_Explosion));
                }
            }
        }
    }
}

